﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using NASA.BeAMartian.Views.Participate;
using NASA.BeAMartian.Model;

namespace NASA.BeAMartian.Views
{
    public partial class StartRoverTagging : PhoneApplicationPage
    {

        public StartRoverTagging()
        {
            InitializeComponent();
            cbLand.tb.IsChecked = null;
            cbLand.TagCount = "(3 of 7)";
            rtl.HeaderText = "Hills";
            rtl.toggleButton.IsChecked = true;
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {

        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            RoverTagging rt = new RoverTagging();
            rt.TaggingFinished += new EventHandler<EventArgs>(rt_TaggingFinished);
            Utils.VisualTreeUtils.FindParentByType<MapRoom>(this).AddTask(new RoverTagging());
        }

        void rt_TaggingFinished(object sender, EventArgs e)
        {            
            NavigationService.Navigate(new Uri("/Views/Participate/RoverTaggingTaskCompleted.xaml", UriKind.RelativeOrAbsolute));
        }

    }
}
